#include <iostream>
using namespace std;

class Singleton{
	public:
		static Singleton* createSin()
		{
			if(NULL == psingle) {	
				psingle = new Singleton();
			}
			cout << "Constructor !" << endl;
			return psingle;
		}
		static void release(Singleton* psin)
		{
			if(NULL != psingle) {
				delete psingle;
			}
			psin = NULL;
			cout << "Destructor !" << endl;
		}
	private:
		Singleton()
		{
			cout << "I am singleton!" << endl;
		}
		static Singleton* psingle;
};

Singleton* Singleton::psingle = NULL;

int main()
{
	Singleton* psingle = Singleton::createSin();
	return 0;
}
